Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgen: fix comptime variant string interpolation #22368

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Sep 30, 2024

@felipensp felipensp marked this pull request as ready for review September 30, 2024 19:16

type SumType = Foo | int | string

fn (v SumType) cast[T](val T) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, that seems complicated for what it is testing.
val is not used anywhere, and seems to have no relation to the bug.

Using fn cast(v SumType) string {, will make it clearer and simpler.

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work.

@spytheman spytheman merged commit d1fdcfb into vlang:master Oct 1, 2024
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cgen: V auto functions is not working in Sumtype variants declaration
2 participants